<?php include './application/views/common/header.php';?>

var img = new Ext.Panel({
	html:'<img src="'+list.baseUrl+'ys-pub/resources/images/zm/logo.png" style="position:absolute; left:20px; top:20px" /><img src="'+list.baseUrl+'ys-pub/resources/images/zm/login-bg.jpg" width="100%" />',
	style:'width:100%;position:absolute'
})

var attr = {};
attr.user_code = '<?php echo $user_code ?>';
attr.rememberPsd = attr.user_code != '';

var frm = new ZM.FormPanel({
	frame:true,
	border:true,
	title:'登录',
	bodyStyle:"height:120px;margin-top:20px;",
	style:'width:360px;padding-top:150px;margin-left:-180px;left:50%;position:absolute',
	url:list.baseUrl + 'login/authenticate',
	keySubmit:true,
	success:function(r){
		location.href = r.addon.url;
	},
	failure:function(){
		captcha.src = list.baseUrl+"login/captcha?"+(new Date().getTime());
		Ext.getCmp('captcha').setValue('');
	},
	items:[{
		fieldLabel:'帐&nbsp;&nbsp;&nbsp;号',
		name:'user_code',
		value:'<?php echo $user_code ?>',
		allowBlank:false
	},{
		fieldLabel:'密&nbsp;&nbsp;&nbsp;码',
		name:'user_password',
		inputType:'password',
		value:'<?php echo $user_password ?>',
		allowBlank:false
	},{
		fieldLabel:'验证码',
		id:'captcha',
		name:'captcha',
		width:161,
		allowBlank:false
	},{
		fieldLabel:'验证码',
		hideLabel:true,
		width:'auto',
		style:'position:absolute;left:255px;margin-top:-26px;',
		html:'<img id="captcha_img" src="'+list.baseUrl+'login/captcha?'+(new Date().getTime())+'" />',
		xtype:'label'
	},{
		fieldLabel:'记住密码',
		xtype:'checkbox',
		value:'1',
		name:'remember_password',
		checked:attr.rememberPsd,
		style:'margin-top:5px;',
		listeners:{
			check:function(cb,checked) {
				attr.rememberPsd = checked;
			}
		}
	}]
});
var viewport = new Ext.Viewport({
	items:[img,frm]
})
var captcha = document.getElementById('captcha_img');
captcha.onclick = function(){
	captcha.src = list.baseUrl+"login/captcha?"+(new Date().getTime());
}
<?php include dirname(__FILE__).'/common/footer.php'; ?>